<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>知乎 - Web版</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.8/css/bootstrap.min.css" rel="stylesheet">
    <!-- Element UI -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/theme-chalk/index.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/7.0.0/css/all.min.css">
    <!-- Vue.js -->
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
    <!-- Element UI -->
    <script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.14/index.min.js"></script>
    <style>
        :root {
            --primary: #0066ff;
            --secondary: #f6f6f6;
            --dark: #1a1a1a;
            --light: #ffffff;
            --gray: #8590a6;
            --border: #ebebeb;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            background-color: #f6f6f6;
            color: var(--dark);
        }

        .navbar {
            background: var(--light);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 10px 0;
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .navbar-brand {
            font-weight: bold;
            color: var(--primary);
            font-size: 1.8rem;
        }

        .search-bar {
            background: var(--secondary);
            border-radius: 18px;
            padding: 8px 15px;
            width: 100%;
            max-width: 500px;
        }

        .nav-link {
            color: var(--dark);
            font-weight: 500;
            padding: 8px 15px;
            border-radius: 5px;
        }

        .nav-link:hover, .nav-link.active {
            color: var(--primary);
            background: rgba(0, 102, 255, 0.08);
        }

        .sidebar {
            position: sticky;
            top: 80px;
            height: calc(100vh - 80px);
            overflow-y: auto;
            padding-top: 20px;
        }

        .question-card {
            background: var(--light);
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            margin-bottom: 15px;
            transition: all 0.3s ease;
        }

        .question-card:hover {
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .question-header {
            padding: 15px 20px;
            border-bottom: 1px solid var(--border);
        }

        .question-content {
            padding: 20px;
        }

        .question-footer {
            padding: 15px 20px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
        }

        .user-info {
            display: flex;
            align-items: center;
        }

        .avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(45deg, #4361ee, #4cc9f0);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            margin-right: 10px;
        }

        .action-btn {
            background: none;
            border: none;
            color: var(--gray);
            padding: 5px 10px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        .action-btn:hover {
            background: var(--secondary);
            color: var(--primary);
        }

        .action-btn i {
            margin-right: 5px;
        }

        .answer-content {
            line-height: 1.6;
            color: #1a1a1a;
        }

        .answer-content img {
            max-width: 100%;
            border-radius: 8px;
            margin: 10px 0;
        }

        .trending-card {
            background: var(--light);
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin-bottom: 15px;
        }

        .trending-item {
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
        }

        .trending-item:last-child {
            border-bottom: none;
        }

        .write-btn {
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 20px;
            padding: 8px 16px;
            font-weight: 500;
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        .write-btn:hover {
            background: #0052cc;
        }

        .write-btn i {
            margin-right: 5px;
        }

        .footer {
            text-align: center;
            padding: 20px 0;
            color: var(--gray);
            font-size: 0.9rem;
        }

        .tag {
            display: inline-block;
            background: rgba(0, 102, 255, 0.1);
            color: var(--primary);
            padding: 3px 10px;
            border-radius: 15px;
            font-size: 0.8rem;
            margin-right: 8px;
            margin-bottom: 8px;
        }

        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- 导航栏 -->
        <nav class="navbar navbar-expand-lg">
            <div class="container">
                <a class="navbar-brand" href="#">
                    <i class="fab fa-zhihu"></i> 知乎
                </a>
                
                <div class="d-flex align-items-center">
                    <div class="search-bar me-3">
                        <i class="fas fa-search text-muted me-2"></i>
                        <input type="text" class="border-0 bg-transparent" placeholder="搜索你感兴趣的内容...">
                    </div>
                    
                    <button class="write-btn me-3">
                        <i class="fas fa-pencil-alt"></i> 提问
                    </button>
                    
                    <div class="dropdown">
                        <div class="d-flex align-items-center" style="cursor: pointer;" @click="showUserMenu = !showUserMenu">
                            <div class="avatar">U</div>
                        </div>
                        
                        <div class="dropdown-menu dropdown-menu-end" :class="{show: showUserMenu}" style="position: absolute; right: 0; margin-top: 10px;">
                            <a class="dropdown-item" href="#"><i class="fas fa-user me-2"></i> 我的主页</a>
                            <a class="dropdown-item" href="#"><i class="fas fa-cog me-2"></i> 设置</a>
                            <a class="dropdown-item" href="#"><i class="fas fa-sign-out-alt me-2"></i> 退出</a>
                        </div>
                    </div>
                </div>
            </div>
        </nav>

        <div class="container mt-4">
            <div class="row">
                <!-- 左侧导航 -->
                <div class="col-lg-2 sidebar d-none d-lg-block">
                    <div class="nav flex-column">
                        <a class="nav-link active" href="#">
                            <i class="fas fa-home me-2"></i> 首页
                        </a>
                        <a class="nav-link" href="#">
                            <i class="fas fa-fire me-2"></i> 热榜
                        </a>
                        <a class="nav-link" href="#">
                            <i class="fas fa-bookmark me-2"></i> 关注
                        </a>
                        <a class="nav-link" href="#">
                            <i class="fas fa-history me-2"></i> 历史
                        </a>
                    </div>
                    
                    <div class="mt-4">
                        <h6 class="text-muted mb-3">我关注的话题</h6>
                        <div class="d-flex flex-wrap">
                            <span class="tag">科技</span>
                            <span class="tag">设计</span>
                            <span class="tag">摄影</span>
                            <span class="tag">旅行</span>
                            <span class="tag">美食</span>
                        </div>
                    </div>
                </div>

                <!-- 主内容区 -->
                <div class="col-lg-7">
                    <!-- 问题列表 -->
                    <div class="question-card" v-for="(question, index) in questions" :key="index">
                        <div class="question-header">
                            <div class="d-flex justify-content-between">
                                <div class="user-info">
                                    <div class="avatar">{{ question.user.avatar }}</div>
                                    <div>
                                        <div class="fw-bold">{{ question.user.name }}</div>
                                        <div class="text-muted small">{{ question.time }}</div>
                                    </div>
                                </div>
                                <button class="btn btn-sm">
                                    <i class="fas fa-ellipsis-h"></i>
                                </button>
                            </div>
                        </div>
                        
                        <div class="question-content">
                            <h5 class="mb-3">{{ question.title }}</h5>
                            <div class="answer-content" v-html="question.content"></div>
                        </div>
                        
                        <div class="question-footer">
                            <div class="d-flex">
                                <button class="action-btn">
                                    <i class="fas fa-arrow-up"></i> {{ question.voteUp }}
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-arrow-down"></i>
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-comment me-1"></i> {{ question.comments }}
                                </button>
                            </div>
                            <div class="d-flex">
                                <button class="action-btn">
                                    <i class="fas fa-share-alt"></i>
                                </button>
                                <button class="action-btn">
                                    <i class="fas fa-bookmark"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 右侧边栏 -->
                <div class="col-lg-3">
                    <div class="trending-card">
                        <h5 class="mb-4"><i class="fas fa-fire text-danger me-2"></i> 热榜</h5>
                        <div class="trending-item" v-for="(item, index) in hotTopics" :key="index">
                            <div class="d-flex align-items-center">
                                <span class="me-2 text-muted" style="font-size: 1.2rem;">{{ index + 1 }}</span>
                                <div>
                                    <div class="fw-bold">{{ item.title }}</div>
                                    <div class="text-muted small">{{ item.hot }} 万热度</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="trending-card">
                        <h5 class="mb-4"><i class="fas fa-users me-2"></i> 推荐用户</h5>
                        <div class="trending-item" v-for="(user, index) in recommendUsers" :key="index">
                            <div class="d-flex align-items-center">
                                <div class="avatar me-2">{{ user.avatar }}</div>
                                <div class="flex-grow-1">
                                    <div class="fw-bold">{{ user.name }}</div>
                                    <div class="text-muted small">{{ user.desc }}</div>
                                </div>
                                <button class="btn btn-outline-primary btn-sm">关注</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="footer">
            <div class="container">
                <p>© 2023 知乎 Web版. 仿制品仅供学习交流使用</p>
                <p class="text-muted small">基于Vue2 + Element UI + Bootstrap构建</p>
            </div>
        </div>
    </div>

    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    showUserMenu: false,
                    questions: [
                        {
                            user: {
                                name: "张三",
                                avatar: "张"
                            },
                            time: "2小时前",
                            title: "如何学习前端开发？",
                            content: "<p>作为一个前端开发新手，我想知道从哪里开始学习。目前我已经掌握了HTML和CSS的基础知识，接下来应该学习什么呢？</p><p>是否应该先学习JavaScript，还是直接学习Vue或React框架？求各位大神指点！</p>",
                            voteUp: 128,
                            comments: 36
                        },
                        {
                            user: {
                                name: "李四",
                                avatar: "李"
                            },
                            time: "5小时前",
                            title: "如何看待人工智能的发展？",
                            content: "<p>最近AI技术发展迅猛，特别是ChatGPT等大模型的出现，引发了广泛讨论。有人认为AI会取代人类工作，也有人认为AI只是工具。</p><p>我想听听大家的看法，AI技术到底会给人类社会带来什么样的影响？</p><img src='https://images.unsplash.com/photo-1677442135722-5f11e06a4e6d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80' alt='AI'>",
                            voteUp: 256,
                            comments: 89
                        },
                        {
                            user: {
                                name: "王五",
                                avatar: "王"
                            },
                            time: "1天前",
                            title: "有哪些值得推荐的旅游目的地？",
                            content: "<p>计划下个月和家人一起去旅行，想听听大家的推荐。我们比较喜欢自然风光，预算在1万元左右，时间大概一周。</p><p>目前考虑的有云南、四川、桂林等地，不知道哪个更值得去？有什么需要注意的地方吗？</p>",
                            voteUp: 97,
                            comments: 42
                        }
                    ],
                    hotTopics: [
                        { title: "高考成绩公布", hot: "320" },
                        { title: "新手机发布", hot: "280" },
                        { title: "世界杯比赛结果", hot: "250" },
                        { title: "新技术趋势", hot: "210" },
                        { title: "夏季旅游推荐", hot: "180" }
                    ],
                    recommendUsers: [
                        { name: "前端小智", avatar: "智", desc: "前端开发专家" },
                        { name: "设计达人", avatar: "设", desc: "UI/UX设计师" },
                        { name: "旅行博主", avatar: "旅", desc: "环球旅行家" },
                        { name: "科技评论员", avatar: "科", desc: "科技领域作者" }
                    ]
                }
            },
            mounted() {
                // 点击其他地方关闭用户菜单
                document.addEventListener('click', (e) => {
                    if (!e.target.closest('.dropdown')) {
                        this.showUserMenu = false;
                    }
                });
            }
        });
    </script>
</body>
</html>